home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus 1999 #2
/
Amiga Plus CD - 1999 - No. 2.iso
/
System-Boost
/
Workbench
/
Archive
/
XPK
/
xpk_Source
/
test
/
testCurrentTime.c
< prev
next >
Wrap
C/C++ Source or Header
|
1998-11-15
|
1KB
|
55 lines
#define NAME "testCurrentTime"
#define DISTRIBUTION "(Freeware) "
#define REVISION "1"
/* Programmheader
Name: testCurrentTime
Author: SDI
Distribution: Freeware
Description: tests CurrentTime function
Compileropts: -gM
Linkeropts: -l amiga
1.1 06.12.96 : added header
*/
#include <proto/intuition.h>
#include <proto/exec.h>
#include <proto/dos.h>
#include "SDI_defines.h"
ULONG DosVersion = 37;
struct Library *IntuitionBase = 0;
void main(void)
{
ULONG sec, usec, sec0, usec0, tim;
if((IntuitionBase = OpenLibrary("intuition.library",33)))
{
CurrentTime(&sec0, &usec0);
Printf("%lu %lu\n",sec0,usec0);
while(!CTRL_C)
{
CurrentTime(&sec, &usec);
if(usec >= usec0)
{
sec = sec - sec0;
usec = usec - usec0;
}
else
{
sec = sec - sec0 - 1;
usec = usec + 1000000 - usec0;
}
tim = (sec<<7) + usec / (1000000>>7);
Printf("%lu %lu %lu\n", sec, usec, tim);
}
CloseLibrary(IntuitionBase);
}
exit(0);
}